#!/usr/bin/env python

import sys, urllib2
from BeautifulSoup import BeautifulSoup

page = "http://www.walottery.com/WinningNumbers/Search.aspx?game=41&days=22"

html = urllib2.urlopen(page).read()
lines = html.split("\n")
found = False
text = []
for line in lines:
  if line.find("winningNumbersSearch_results"):
    found = True
  if found:
    text.append(line)

print text
soup = BeautifulSoup("".join(text))
table = soup.find("table")

print table
